package com.mantru.iotpot.dao;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

import androidx.annotation.Nullable;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/**
 * 一键养锅置表
 * 作者： cmh
 * 日期： 2022/12/19
 */

public class t_public_config_feed_pot
{
    public String table_name = "t_public_config_feed_pot";
    public String clean_id,steep_index,pot_position,fire_value,time_value,time_long,speed_value,rotation_value,status,tts_text,update_time;
    public String create_sql = "create table t_public_config_feed_pot(clean_id integer primary key, steep_index integer,pot_position integer,fire_value integer,time_value text,time_long integer,speed_value integer,rotation_value integer,status integer,tts_text text,update_time text)";
    public String drop_sql = "drop tabel t_public_config_feed_pot";
    public String entity_sql = "1=1";
    public String list_sql = "select * from t_public_config_feed_pot order by steep_index";
    public String delete_sql = "delete from t_public_config_feed_pot where clean_id=? ";
    public String update_sql = "update t_public_config_feed_pot set pot_position=?,fire_value=?,time_value=?,time_long=?,speed_value=?,rotation_value=?,status=? where clean_id=? ";
    public String max_sql = "select ifnull(max(clean_id),0) as clean_id from t_public_config_feed_pot";
    public String update_steepindex_sql = "update t_public_config_feed_pot set steep_index=steep_index+1 where steep_index>=?";

    public String[] GetEntityValues()
    {
        String[] values = new String[0];
        return values;
    }

    public String[] GetDeleteValues()
    {
        String[] values = new String[1];
        values[0] = clean_id;
        return values;
    }

    public String[] GetUpdateValues()
    {
        String[] values = new String[8];
        values[0] = pot_position;
        values[1] = fire_value;
        values[2] = time_value;
        values[3] = time_long;
        values[4] = speed_value;
        values[5] = rotation_value;
        values[6] = status;
        values[7] = clean_id;
        return values;
    }

    public String[] GetUpdateSteepIndexValues()
    {
        String[] values = new String[1];
        values[0] = steep_index;
        return values;
    }

    public ContentValues GetInsertContentValues()
    {
        ContentValues cv = new ContentValues();
        cv.put("clean_id", clean_id);
        cv.put("steep_index", steep_index);
        cv.put("pot_position", pot_position);
        cv.put("fire_value", fire_value);
        cv.put("time_value", time_value);
        cv.put("time_long", time_long);
        cv.put("speed_value", speed_value);
        cv.put("rotation_value", rotation_value);
        cv.put("status", status);
        cv.put("tts_text", tts_text);
        cv.put("update_time", update_time);
        return cv;
    }
}
